#ifndef CAUDIOCONTROLDEVICE_H
#define CAUDIOCONTROLDEVICE_H

#include <QObject>
#include "audio_control.h"
#include "control/cknxcontrol.h"

#define AUDIO_DEBUG    1

class DEVICE_OPERATION : public QObject
{
    Q_OBJECT
public:
    explicit DEVICE_OPERATION(QObject *parent = nullptr);
    static QStringList LIST_AREA_NAME;
    //外部的现有设备
    QString _id;
    QStringList _id_all;
    QString _name;
    DEVICE_AUDIOCONTROL _device_type;
    QStringList _support_operation;

    //语音分析的结果
    QString _audio_name;
    QString _audio_name_en;
    QString _audio_operation;
    QString _audio_value;
    QString _audio_calc;
    //名字通称
    bool _audio_action_dev_all;
    //区域覆盖行为
    QString _audio_area_zone;
    bool _audio_area_action;

    //匹配结果
    bool _match;
    //返回语音
    QString _ret_word;
};

class CAudioControlDevice : public QObject
{
    Q_OBJECT
public:
    explicit CAudioControlDevice(QObject *parent = nullptr);
    DEVICE_AUDIOCONTROL whichDevice(QString word);

    virtual DEVICE_OPERATION * parseWord(QString word) = 0;
    virtual bool actionAudionControl(DEVICE_OPERATION *d) = 0;
    virtual void addDevice(DEVICE_OPERATION *d) = 0;
    virtual void clearDevice() = 0;

    QList<DEVICE_OPERATION *> _device_list;

};

#endif // CAUDIOCONTROLDEVICE_H
